<template>
  <div>
    <Chart :cdata="cdata"/>
  </div>
</template>

<script>
import Chart from './chart.vue';

export default {
  props: ['data'],
  data() {
    return {
      cdata: {
        xData: [],
        seriesData: []
      }
    }
  },
  components: {
    Chart,
  },
  mounted() {

  },
  methods: {
    initData(data) {
      console.log('data=>', data)
      let xData = []
      let seriesData = []
      data.map(v => {
        xData.push(v.text)
        seriesData.push({
          value: v.number.number[0],
          name: v.text
        })
      })
      this.cdata.xData = xData
      this.cdata.seriesData = seriesData
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
